import React from 'react'
// ===================================================================== Temp
import Table from '#cpt/temp/Table'
// ===================================================================== global declare
const { $fn } = window
// ===================================================================== $Lazy
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:[],
		pag: {},
		selectedKeys:[],
	}	
	
	componentDidMount(){
		this.fetch()
	}
	
	fetch = () => $fn.fetch.call(this,'specimen/fastEntryCaseInfo', { isIndex: true} )
	
	// 关联表单
	cols = [
		{ title: '条码号',		dataIndex: 'spec_code', 		...$fn.table.spec_code, },
		{ title: '姓名', 		dataIndex: 'patient_name', 		...$fn.table.name },
		{ title: '性别', 		dataIndex: 'sex_name', 			...$fn.table.sex },
		{ title: '送检医院', 	dataIndex: 'hosp_name', 		width:180 },
	]

	render(){
		return (
			<>
				{/* 子表格 */}
				{Table.call(this,{ type: 1, isIndex: true,
					onRow: ( rows,index )=>{
						this.props.tableRow(rows,index)
					},
					onRowClass: ({case_info_status}) => {
						return +case_info_status === 2 ? 'row-e24747' : null
					}
				})}
			</>
		)
	}
}

export default Index